package com.codedef.cidaren.controller;

import com.codedef.cidaren.common.response.Result;
import com.codedef.cidaren.common.response.ResultCode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/api/answer")
public class AnswerController {

    @RequestMapping(value = "/ans", method = {RequestMethod.GET, RequestMethod.POST})
    @Cacheable(value = "ans")
    public String queryAnswer(@RequestBody Map<String, Object> reqMap) {
        log.info("reqMap is {}", reqMap);
        //new Result(ResultCode.SUCCESS, new Date());
        return new Date().toString();
    }

}
